<%
Class TEditor
    Public Kind
    Public CanUpload
    Public CanBrowse
    Public Value
    Public Toolbar
    Public BasePath
 
    Public Sub Create(a_name,a_width,a_height)
        Dim oEditor
        Dim sHtml

        Select Case(LCase(Trim(Kind)))
        Case gbl_sEditor_Innova
            sHtml = "<script src=""editor\innovaeditor\scripts\innovaeditor.js""></script>" & Chr(10)
            sHtml = sHtml & "<script type=""text/javascript"">" & Chr(10)
            sHtml = sHtml & "</script>" & Chr(10)
            Response.Write(sHtml)
        Case gbl_sEditor_eWeb
            sHtml = "<input name='" & a_Name & "' type='hidden' id='" & a_Name & "' value='" & Value & "' />" & Chr(10)
            sHtml = sHtml & "<iframe id='eWebEditor1' src='editor/ewebeditor/ewebeditor.htm?id=" & a_Name & "&style=ZxsV&extcss=css/myeditorarea.css' frameborder='0' scrolling='No' width='" & a_Width & "' height='" & a_Height & "'></iframe>" & Chr(10)
            Response.Write(sHtml)
        Case gbl_sEditor_TinyMce
            sHtml = "<script type=""text/javascript"" src=""editor/tinymce/tiny_mce.js""></script>" & Chr(10)
            sHtml = sHtml & "<script type=""text/javascript"" src=""editor/tinymce/full.js""></script>" & Chr(10)
            sHmtl = sHtml & "<textarea id=""" & a_Name & """ name=""" & a_Name & """ rows=""15"" cols=""80"" style=""width: 100%"">" & Chr(10)
            sHtml = sHmtl & Server.HtmlEncode(Value) & "</textarea>" & Chr(10)
            Response.Write(sHtml)
        Case gbl_sEditor_HtmlArea
            sHtml = sHtml & "<script type=""text/javascript"">" & Chr(10)
            sHtml = sHtml & "  _editor_url = ""editor/htmlarea/"";" & Chr(10)
            sHtml = sHtml & "  _editor_lang = ""en"";" & Chr(10)
            sHtml = sHtml & "</script>" & Chr(10)
            sHtml = sHtml & "<script type=""text/javascript"" src=""editor/htmlarea/htmlarea.js""></script>" & Chr(10)
            sHtml = sHtml & "<script type=""text/javascript"" src=""editor/htmlarea/plugins.js""></script>" & Chr(10)
            sHtml = sHtml & "<script type=""text/javascript"" src=""editor/htmlarea/load.js""></script>" & Chr(10)
            sHtml = sHtml & "<textarea id=""" & a_Name & """ name=""" & a_Name & """ style=""width:100%"" rows=""24"" cols=""80"">" & Chr(10)
            sHtml = sHtml & Server.HtmlEncode(Value) & "</textarea>" & Chr(10)
            sHtml = sHtml & "<script type=""text/javascript"">" & Chr(10)
            sHtml = sHtml & "initEditor('" & a_Name & "');" & Chr(10)
            sHtml = sHtml & "</script>" & Chr(10)
            Response.Write(sHtml)
        Case Else 'editor/fckeditor/
            Execute(includeFile("../../editor/fckeditor.asp","gb2312","gb2312"))
            Set oEditor = New FCKEditor
 
            If isNone(Toolbar) Then
                oEditor.ToolbarSet = "Default"
            Else
                oEditor.ToolbarSet = Toolbar
            End If
  
            If isNone(BasePath) Then
                oEditor.BasePath = "../../editor/"
            Else
                oEditor.BasePath = BasePath
            End If

            oEditor.Value= Value
            oEditor.Width = a_width
            oEditor.Height = a_height
            oEditor.Create a_name
        End Select
    End Sub
End Class

Dim oEditor
Set oEditor = New TEditor
oEditor.BasePath = "../../editor/"
oEditor.Toolbar = "Default"

Dim oEditBasic
Set oEditBasic = New TEditor
oEditBasic.BasePath = "../../editor/"
oEditBasic.Toolbar = "Basic"
%>